package cn.egeek.babel.service;

import java.util.List;

import cn.egeek.babel.dao.CommentDAO;
import cn.egeek.babel.entity.Comment;

public class CommentService {
	CommentDAO commentDAO;

	@SuppressWarnings("unchecked")
	public List<Comment> queryByTopicId (Long id) {
		return commentDAO.findByProperty("topic_id", id);
	}
	
	@SuppressWarnings("unchecked")
	public List<Comment> getAll() {
		return commentDAO.findAll();
	}

	public void remove(Long id) {
		// TODO Auto-generated method stub
	}

	public void save(Comment model) {
		commentDAO.save(model);
	}

	public Comment get(Long id) {
		return commentDAO.findById(id);
	}

	public CommentDAO getCommentDAO() {
		return commentDAO;
	}

	public void setCommentDAO(CommentDAO commentDAO) {
		this.commentDAO = commentDAO;
	}
}
